//
//  CollectImage.m
//  qulvyou
//
//  Created by mmyy on 15/10/19.
//  Copyright (c) 2015年 mmyy. All rights reserved.
//

#import "CollectImage.h"
#import "CoreData+MagicalRecord.h"
@implementation CollectImage
@dynamic data;
@dynamic vid;

+(NSArray *)getAllDate
{
    NSArray *array = [CollectImage MR_findAll];
    return array;

}

+(void)removeDateWithVid:(NSString *)vid
{
    CollectImage *items = [[CollectImage MR_findAllWithPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"vid like '%@'", vid]]] lastObject];
    [items MR_deleteEntity];
    [[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreAndWait];
}
+(BOOL)searchImage:(NSString *)vid
{
    NSArray *arr = [CollectImage MR_findAllWithPredicate:[NSPredicate predicateWithFormat:@"vid like %@", vid]];
    if (arr.count != 0) {
        return NO;
    }else {
        return YES;
    }
}
@end
